//
//  MLASavePinSupplierCell.m
//  MagicLampApp
//
//  Created by Zheng on 2018/12/24.
//  Copyright © 2018 zheng.magic.lamp.app. All rights reserved.
//

#import "MLASavePinSupplierCell.h"
#import "MLASavePinSupplierModel.h"

@implementation MLASavePinSupplierCell {
    UILabel *cateLbl;
    UILabel *nameLbl;
    UILabel *moneyLbl;
    
    UILabel *dateLbl;
    UILabel *buyerLbl;
    UILabel *checkLbl;
}

- (void)setModel:(MLASavePinSupplierModel *)model {
    _model = model;
    
    cateLbl.text = [NSString stringWithFormat:@"名称：%@",_model.company_name];
    nameLbl.text = [NSString stringWithFormat:@"联系人：%@",_model.linkman];
    moneyLbl.text = [NSString stringWithFormat:@"电话：%@",_model.phone];
    dateLbl.text = _model.ctime;
    checkLbl.text = [NSString stringWithFormat:@"客户类型：%@",_model.type];
    buyerLbl.text = [NSString stringWithFormat:@"商品类型：%@",_model.type_name];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        cateLbl = [[UILabel alloc] init];
        cateLbl.font = CX_GetNormalFont(12);
        cateLbl.textColor = CX_GetColorTitle();
        [self.shadowView addSubview:cateLbl];
        [cateLbl mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(15);
            make.top.mas_equalTo(20);
        }];
        
        nameLbl = [[UILabel alloc] init];
        nameLbl.font = CX_GetNormalFont(12);
        nameLbl.textColor = CX_GetColorTitle();
        [self.shadowView addSubview:nameLbl];
        [nameLbl mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(15);
            make.top.equalTo(self->cateLbl.mas_bottom).offset(8);
        }];
        
        moneyLbl = [[UILabel alloc] init];
        moneyLbl.font = CX_GetNormalFont(12);
        moneyLbl.textColor = CX_GetColorTitle();
        [self.shadowView addSubview:moneyLbl];
        [moneyLbl mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(15);
            make.top.equalTo(self->nameLbl.mas_bottom).offset(8);
        }];
        
        dateLbl = [[UILabel alloc] init];
        dateLbl.textColor = CX_GetColorHex(0x999999, 1);
        dateLbl.font = CX_GetNormalFont(10);
        [self.shadowView addSubview:dateLbl];
        [dateLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(-15);
            make.centerY.equalTo(self->cateLbl);
        }];
        
        buyerLbl = [[UILabel alloc] init];
        buyerLbl.font = CX_GetNormalFont(12);
        buyerLbl.textColor = CX_GetColorTitle();
        [self.shadowView addSubview:buyerLbl];
        [buyerLbl mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(-15);
            make.centerY.equalTo(self->nameLbl);
        }];
        
        checkLbl = [[UILabel alloc] init];
        checkLbl.font = CX_GetNormalFont(12);
        checkLbl.textColor = CX_GetColorTitle();
        [self.shadowView addSubview:checkLbl];
        [checkLbl mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(-15);
            make.centerY.equalTo(self->moneyLbl);
        }];
        
        /*
         cateLbl.text = @"名称：xx责任有限公司";
         nameLbl.text = @"联系人：张三";
         moneyLbl.text = @"电话：188888888";
         dateLbl.text = @"2018.9.9 12：21";
         buyerLbl.text = @"商品类型：办公用品";
         checkLbl.text = @"客户类型：采购商";
         */
    }
    return self;
}

@end
